package top.digger.web.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import top.digger.web.entity.HotSearch;
import top.digger.web.entity.SysUser;
import top.digger.web.entity.common.page.TableDataInfo;
import top.digger.web.service.HotSearchService;

import java.util.ArrayList;
import java.util.List;

@Controller
@RequestMapping("/hot")
public class HotSearchReportController extends BaseController{

    @Autowired
    private HotSearchService hotSearchService;

    private String prefix = "data/hot";

    @GetMapping("/page")
    public String echarts()
    {
        return prefix + "/page";
    }

    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list()
    {
        startPage();
        List<HotSearch> list = hotSearchService.selectHotSearchList();
        return getDataTable(list);
    }
}
